package mylib.archive.y2012.m09.CF138;

import mylib.dir.FastInputReader;

import java.io.PrintWriter;

public class TaskB {
    public void solve(int testNumber, FastInputReader in, PrintWriter out) {
        char[] s = in.nextString().toCharArray();
        char[] t = in.nextString().toCharArray();
        int n = s.length;
        int[] maxLenPrefix = new int[n];
        int[] maxLenSuffix = new int[n];
        int[][] sum = new int[t.length][26];
        for (int i = 0; i < t.length; ++i) {
            if (i != 0) {
                for (int j = 0; j < 26; ++j)
                    sum[i][j] += sum[i - 1][j];
            }
            sum[i][t[i] - 'a']++;
        }
        for (int i = 0; i < n; ++i) {
            if (i == 0) {
                maxLenPrefix[i] = (s[i] == t[i] ? 1 : 0);
            } else {
                int r = maxLenPrefix[i - 1];
                if (r < t.length && t[r] == s[i]) ++r;
                r = Math.min(r, t.length);
                maxLenPrefix[i] = r;
            }
        }
        for (int i = n - 1; i >= 0; --i) {
            if (i == n - 1) {
                maxLenSuffix[i] = (s[s.length - 1] == t[t.length - 1] ? 1 : 0);
            } else {
                int r = maxLenSuffix[i + 1];

                if (r < t.length && t[t.length - r - 1] == s[i]) ++r;
                r = Math.min(r, t.length);
                maxLenSuffix[i] = r;
            }
        }
        boolean ok = true;
        for (int i = 0; i < n; ++i) {
            int lt = (i == 0 ? 0 : maxLenPrefix[i - 1]);
            int rt = (i == n - 1 ? 0 : maxLenSuffix[i + 1]);
            if (lt + rt + 1 < t.length) ok = false;
            else if (lt + rt + 1 == t.length) {
                ok &= t[lt] == s[i];
            } else {
                ok &= contains(t.length - rt - 1, lt, s[i], sum);
            }
        }
        out.print(ok ? "Yes" : "No");

    }

    private boolean contains(int l, int r, char s, int[][] sum) {
        l = Math.max(0, l);
        r = Math.min(r, sum.length - 1);
        l = Math.min(l, sum.length - 1);
        r = Math.max(r, 0);
        int c = sum[r][s - 'a'] - (l == 0 ? 0 : sum[l - 1][s - 'a']);
        return c > 0;
    }
}
